<?php
$this->breadcrumbs = array(
    'Countries' => array('admin'),
    'Manage',
);

$this->menu = array(
    array('label' => 'Manage Country', 'url' => array('admin'), 'active' => true),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('country-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Countries</h1>

<?php echo CHtml::link('Search', '#', array('class' => 'search-button btn')); ?>
<div class="search-form" style="display:none">
    <?php
    $this->renderPartial('_search', array(
        'model' => $model,
    ));
    ?>
</div><!-- search-form -->
<?php
$this->widget('bootstrap.widgets.TbButton', array(
    'label' => 'Add',
    'type' => 'primary', // null, 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
    //'size'=>'large', // null, 'large', 'small' or 'mini'
    'icon' => 'plus white',
    'url' => array('create'),
));

$this->widget('bootstrap.widgets.TbGridView', array(
    'id' => 'country-grid',
    'dataProvider' => $model->search(),
    'type' => 'striped bordered condensed',
    //'filter'=>$model,
    'columns' => array(
        //'id',
        'name',
        array(
            'class' => 'bootstrap.widgets.TbButtonColumn',
            'template' => '{update} {delete}',
        ),
    ),
    'htmlOptions' => array(
//        'style' => 'width: 300px',
    ),
));
?>
